/*
 * @Author: hyman
 * @Date: 2022-02-08 16:34:33
 * @LastEditors: hyman
 * @LastEditTime: 2022-02-11 14:27:21
 * @Description: 请填写简介
 */
export const sleep = (time) =>
  new Promise(resolve => setTimeout(resolve, time))

export async function mockUpload(file) {
  await sleep(2000)
  return {
    url: URL.createObjectURL(file),
    file: file,
  }
}

export async function mockUploadFail() {
  await sleep(1000)
  throw new Error('Fail to upload')
}

